#ifndef SDATAHANDLE_H_INCLUDED
#define SDATAHANDLE_H_INCLUDED

#include "GLOBAL.h"

/// //////////////
/// Data handle
/// //////////////
struct sDataHandle {
	uint m_uiIndex		: 12;		///< Index bits
	uint m_uiCounter	: 15;		///< Counter bits
	uint m_uiType		:  5;		///< Type bits

	inline operator uint ( ) const {
		return (uint)(m_uiType << 27 | m_uiCounter << 12 | m_uiIndex);
	}

	// C&D
	sDataHandle( ) : m_uiIndex(0), m_uiCounter(0), m_uiType(0) { }
	sDataHandle( uint index, uint counter, uint type ) {
		m_uiIndex = index;
		m_uiCounter = counter;
		m_uiType = type;
	}
};

static const sDataHandle NO_DATA = sDataHandle();
typedef sDataHandle DATAH;

enum DATAH_TYPE {
	DATAT_RENDERABLE = 0
};

#endif // SDATAHANDLE_H_INCLUDED
